package com.sdau.repairmaster.UIFile.adapter;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.List;

public class MyPagerAdapter extends FragmentPagerAdapter {

    private String[] mTitles;
    private List<Fragment> mFragments;
    public MyPagerAdapter(FragmentManager fragmentManager,String[] mTitles,List<Fragment> mFragments) {
        super(fragmentManager);
        this.mTitles = mTitles;
        this.mFragments = mFragments;
    }

    @Override
    public int getCount() {

        return mFragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {

        return mTitles[position];
    }

    @Override
    public Fragment getItem(int position) {

        return mFragments.get(position);
    }
}
